#include <iostream>
using namespace std;

int primes[2019], cnt;
bool st[2019];

void get_primes(int n) {
    for (int i = 2; i <= n; ++i) {
        if (!st[i]) primes[cnt++] = i;
        for (int j = 0; primes[j] * i <= n; ++j) {
            st[primes[j] * i] = true;
            if (i % primes[j] == 0) break;
        }
    }
}

int main()
{
    get_primes(2019);
    int res = 0;
    for (int i = 0; i <= 2019 && primes[i] != 0; ++i) {
        for (int j = i + 1; j <= 2019 && primes[j] != 0; ++j) {
//            if (primes[i] + primes[j] == 2019) {
//                cout << primes[i] << ' ' << primes[j] << '\n';
//                res++;
//            }
            cout << primes[i] << ' ' << primes[j] << '\n';
        }
    }
    cout << res;
    return 0;
}